package pageObject;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.interactions.Actions;

public class PostFreeAd {

	private WebDriver driver;
	
	public PostFreeAd(WebDriver driver){
		
		this.driver = driver;
	}
	
	//Mouse Over Car & bikes
	public PostFreeAd carAndBikesMouseOver() throws Exception{
		Actions act = new Actions(driver);
		act.moveToElement(driver.findElement(By.xpath("//div[text() = 'Cars & Bikes']")));
		act.build().perform();
		
		Thread.sleep(2000);
		
		return this;
	}
	
	public UploadAd clickOnCars() throws Exception{
		driver.findElement(By.xpath("//a[text() = ' Cars']")).click();
		
		return new UploadAd(driver);
	}
	
}
